package com.io.example.demoparent.responsibility;

/**
 *  职责链模式
 */
public class Client {
    public static void main(String[] args) {
        /**
         *  创建一个请求
         */
        PurchaseRequest purchaseRequest = new PurchaseRequest(1, 20000, 1);
        //创建审批人
        DepartmentApprover departmentApprover = new DepartmentApprover( "张主任");
        CollegeApprover collegeApprover = new CollegeApprover("李院长");
        ViceSchoolMasterApprover viceSchoolMasterApprover = new ViceSchoolMasterApprover("副校长");
        departmentApprover.setApprover(collegeApprover);
        collegeApprover.setApprover(viceSchoolMasterApprover);
        viceSchoolMasterApprover.setApprover(departmentApprover);
        // 需要将各个审批级别的下一个设置好 处理构成环形或者单链
        departmentApprover.processRequest(purchaseRequest);

    }
}
